﻿using System;
using System.Collections.Generic;
using System.Web;
using Itop.YHPC.Model;
using Itop.YHPC.BLL;

namespace Itop.YHPC.controller {
    public class sysuserController {
        static sysuserBLL bll;

        public static sysuserBLL Bll {
            get {
                if (bll == null)
                    bll=Global.GetService<sysuserBLL>();
                return sysuserController.bll; }
        }
        public static IList<sysuser> GetList(string where){
            return Bll.SelectByWhere(where);
        }
        public static string GetListJson(string where) {
            IList<sysuser> list = Bll.SelectByWhere(where);
            return Newtonsoft.Json.JsonConvert.SerializeObject(list);
        }
        public static object Insert(sysuser user) {
           return  Bll.Insert(user);
        }
        public static object Update(sysuser user) {
            return Bll.Update(user);
        }
        public static object Delete(string key) {
            return Bll.Delete(key);
        }
        public static object UpdateJson(string strUser) {
            sysuser user = Newtonsoft.Json.JsonConvert.DeserializeObject<sysuser>(strUser);
            if (user == null) return null;
            return Bll.Update(user);
        }
    }
}
